package cn.sciento.farm.devicemanager.gateway.model.uplink.fertilizer.inject;

import cn.sciento.farm.devicemanager.common.util.NumberUtil;
import lombok.Data;

import java.util.List;

@Data
public class InjectFertilizerStatus {

    private String eui;

    private Float ec;

    private Float ph;

    private WaterPipe waterPipe;

    private FatPipe fatPipe;

    @Data
    public static class WaterPipe{
        private Double instantFlow;
    }

    @Data
    public static class FatPipe{
        List<PipeStatus> variable;
    }


    public static class PipeStatus{
        private Double instantFlow;
        private Float ratio;
        private Float pressure;

        public Double getInstantFlow() {
            return instantFlow;
        }

        public void setInstantFlow(Double instantFlow) {
            this.instantFlow = instantFlow;
        }

        public Float getRatio() {
            return NumberUtil.float2float(ratio,2);
        }

        public void setRatio(Float ratio) {
            this.ratio = ratio;
        }

        public Float getPressure() {
            return pressure;
        }

        public void setPressure(Float pressure) {
            this.pressure = pressure;
        }
    }
}
